package com.my.study.ext;

import org.springframework.context.ApplicationEvent;

/**
 * 自定义事件
 *
 * @author Carlos
 * @version 1.0.0
 * @date 2021/11/30 8:14
 */
public class CustomApplicationEvent extends ApplicationEvent {

    private String version;

    /**
     * Create a new {@code ApplicationEvent}.
     *
     * @param source the object on which the event initially occurred or with
     *               which the event is associated (never {@code null})
     */
    public CustomApplicationEvent(String source, String version) {
        super(source);
        this.version = version;
    }

    @Override
    public String getSource() {
        return (String) super.getSource();
    }

    public String getVersion() {
        return version;
    }
}
